package cn.shopifymall.studying.kit;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * @Author 孤风雪影
 * @Email gitee.com/efairy520
 * @Date 2025/1/16 12:23
 * @Version 1.0
 */
public class FileChangeTest {
    public static void main(String[] args) throws Exception {
        File file = new File("D:\\Develop\\IdeaProject\\studying\\swift-kit\\target\\classes\\cn\\shopifymall\\studying\\kit\\SalaryCaler.class");
        FileInputStream fis = new FileInputStream(file);

        File targetFile = new File("D:\\Develop\\IdeaProject\\studying\\swift-kit\\target\\classes\\cn\\shopifymall\\studying\\kit\\SalaryCaler.myclass");
        FileOutputStream fos = new FileOutputStream(targetFile);

        int code = 1;
        fos.write(code);

        while ((code = fis.read()) != -1) {
            fos.write(code);
        }

        fis.close();
        fos.close();
    }
}
